package com.hdax.dm.feign.user;

import com.hdax.dm.entity.user.DmLinkUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("dm-user-provider")
public interface DmLinkUserFeign {

    /**
     * 根据linkid返回联系人信息
     * @param linkId
     * @return
     */
    @PostMapping(path = "/linkUser/findById")
    DmLinkUser findById(@RequestParam("linkId")Long linkId);

    /**
     * 根据userid返回常用联系人
     * @param userId
     * @return
     */
    @PostMapping(path = "/linkUser/findLinkUserByuserId")
    List<DmLinkUser> findLinkUserByuserId(@RequestParam("userId")Long userId);

    /**
     * 验证购票人是否已经存在
     * @param idCard
     * @return
     */
    @PostMapping(path = "/linkUser/linkUserisExist")
    DmLinkUser linkUserisExist(@RequestParam("idCard")String idCard);

    /**
     * 添加常用购票人
     * @param dmLinkUser
     * @return
     */
    @PostMapping(path = "/linkUser/addLinkUser")
    int addLinkUser(@RequestBody DmLinkUser dmLinkUser);

    /**
     * 删除购票人
     * @param linkId
     * @return
     */
    @PostMapping(path = "/linkUser/deleteLinkUser")
    int deleteLinkUser(@RequestParam("linkId")Long linkId);
}
